/**   
 * 项目名：五位一体化工安全信息平台
 * 日期：    2019-11-24 22:18:21  
 * Copyright (c) 2015- joysuch-版权所有     
 */

package com.joysuch.wwyt.risk.entity;

import com.joysuch.wwyt.core.support.AutoSetCommonFieldListener;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLDeleteAll;
import org.hibernate.annotations.Where;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;

import static javax.persistence.GenerationType.IDENTITY;

@EntityListeners({ AuditingEntityListener.class, AutoSetCommonFieldListener.class })
@Entity
@Table(name = "WWYT_RISK_EVALUATION_PLAN")
@SQLDelete(sql = "update WWYT_RISK_EVALUATION_PLAN set DELETE_FLAG = '1' where id= ?")
@SQLDeleteAll(sql = "update WWYT_RISK_EVALUATION_PLAN set DELETE_FLAG = '1' where id= ?")
@Where(clause = "DELETE_FLAG = '0'")

public class RiskEvaluationPlan implements java.io.Serializable {

    // columns START
    // ID
    private java.lang.Long id;
    // 风险点ID
    private java.lang.Long riskPointId;
    // 上一次评估时间
    private java.util.Date lastEvaluationTime;
    // 下一次评估时间
    private java.util.Date nextEvaluationTime;
    // 策略
    private java.lang.String strategy;
    // 评估间隔
    private java.lang.Integer period;
    // 评估间隔单位（天、周、月、半年、年）
    private java.lang.String intervalUnit;
    // 创建人
    private java.lang.Long createBy;
    // 创建时间
    private java.util.Date createTime;
    // 更新人
    private java.lang.Long updateBy;
    // 更新时间
    private java.util.Date updateTime;
    // 删除标记
    private java.lang.String deleteFlag;
    // 组织机构代码
    private java.lang.String orgCode;
    // 租户
    private java.lang.Long tenentId;
    // columns END
    // 风险分区ID
    private java.lang.Long riskDistrictId;
    //通知表id
    private String notifyIdJson;

    public String getNotifyIdJson() {
        return notifyIdJson;
    }

    public void setNotifyIdJson(String notifyIdJson) {
        this.notifyIdJson = notifyIdJson;
    }

    public void setId(java.lang.Long value) {
        this.id = value;
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "Id", unique = true, nullable = false)
    public java.lang.Long getId() {
        return this.id;
    }

    @Column(name = "RISK_POINT_ID")
    public java.lang.Long getRiskPointId() {
        return this.riskPointId;
    }

    public void setRiskPointId(java.lang.Long value) {
        this.riskPointId = value;
    }

    @Column(name = "LAST_EVALUATION_TIME")
    public java.util.Date getLastEvaluationTime() {
        return this.lastEvaluationTime;
    }

    public void setLastEvaluationTime(java.util.Date value) {
        this.lastEvaluationTime = value;
    }

    @Column(name = "NEXT_EVALUATION_TIME")
    public java.util.Date getNextEvaluationTime() {
        return this.nextEvaluationTime;
    }

    public void setNextEvaluationTime(java.util.Date value) {
        this.nextEvaluationTime = value;
    }

    @Column(name = "STRATEGY", length = 10)
    public java.lang.String getStrategy() {
        return this.strategy;
    }

    public void setStrategy(java.lang.String value) {
        this.strategy = value;
    }

    @Column(name = "PERIOD")
    public java.lang.Integer getPeriod() {
        return this.period;
    }

    public void setPeriod(java.lang.Integer value) {
        this.period = value;
    }

    @Column(name = "INTERVAL_UNIT", length = 4)
    public java.lang.String getIntervalUnit() {
        return this.intervalUnit;
    }

    public void setIntervalUnit(java.lang.String value) {
        this.intervalUnit = value;
    }

    @org.springframework.data.annotation.CreatedBy
    @Column(name = "CREATE_BY")
    public java.lang.Long getCreateBy() {
        return this.createBy;
    }

    public void setCreateBy(java.lang.Long value) {
        this.createBy = value;
    }

    @Column(name = "RISK_DISTRICT_ID")
    public java.lang.Long getRiskDistrictId() {
        return riskDistrictId;
    }

    public void setRiskDistrictId(java.lang.Long riskDistrictId) {
        this.riskDistrictId = riskDistrictId;
    }

    @org.springframework.data.annotation.CreatedDate
    @Column(name = "CREATE_TIME")
    public java.util.Date getCreateTime() {
        return this.createTime;
    }

    public void setCreateTime(java.util.Date value) {
        this.createTime = value;
    }

    @org.springframework.data.annotation.LastModifiedBy
    @Column(name = "UPDATE_BY")
    public java.lang.Long getUpdateBy() {
        return this.updateBy;
    }

    public void setUpdateBy(java.lang.Long value) {
        this.updateBy = value;
    }

    @org.springframework.data.annotation.LastModifiedDate
    @Column(name = "UPDATE_TIME")
    public java.util.Date getUpdateTime() {
        return this.updateTime;
    }

    public void setUpdateTime(java.util.Date value) {
        this.updateTime = value;
    }

    @Column(name = "DELETE_FLAG", length = 2)
    public java.lang.String getDeleteFlag() {
        return this.deleteFlag;
    }

    public void setDeleteFlag(java.lang.String value) {
        this.deleteFlag = value;
    }

    @Column(name = "ORG_CODE", length = 100)
    public java.lang.String getOrgCode() {
        return this.orgCode;
    }

    public void setOrgCode(java.lang.String value) {
        this.orgCode = value;
    }

    @Column(name = "TENENT_ID")
    public java.lang.Long getTenentId() {
        return this.tenentId;
    }

    public void setTenentId(java.lang.Long value) {
        this.tenentId = value;
    }

    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("id", getId())
                .append("riskPointId", getRiskPointId()).append("lastEvaluationTime", getLastEvaluationTime())
                .append("nextEvaluationTime", getNextEvaluationTime()).append("strategy", getStrategy())
                .append("period", getPeriod()).append("intervalUnit", getIntervalUnit())
                .append("createBy", getCreateBy()).append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy()).append("updateTime", getUpdateTime())
                .append("deleteFlag", getDeleteFlag()).append("orgCode", getOrgCode()).append("tenentId", getTenentId())
                .toString();
    }

    public int hashCode() {
        return new HashCodeBuilder().append(getId()).toHashCode();
    }

    public boolean equals(Object obj) {
        if (obj instanceof RiskEvaluationPlan == false)
            return false;
        if (this == obj)
            return true;
        RiskEvaluationPlan other = (RiskEvaluationPlan) obj;
        return new EqualsBuilder().append(getId(), other.getId()).isEquals();
    }
}
